﻿<Page
    x:Name="pageRoot"
    x:Class="Babelless.MainPage"
    DataContext="{Binding DefaultViewModel, RelativeSource={RelativeSource Self}}"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="using:Babelless"
    xmlns:common="using:Babelless.Common"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    mc:Ignorable="d">

    <Page.Resources>
        <!-- TODO: Delete this line if the key AppName is declared in App.xaml -->
        <x:String x:Key="AppName">BabellessTranscoder</x:String>
    </Page.Resources>

    <!--
        This grid acts as a root panel for the page that defines two rows:
        * Row 0 contains the back button and page title
        * Row 1 contains the rest of the page layout
    -->
    <Grid Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
        <Grid.ChildrenTransitions>
            <TransitionCollection>
                <EntranceThemeTransition/>
            </TransitionCollection>
        </Grid.ChildrenTransitions>
        <Grid.RowDefinitions>
            <RowDefinition Height="140"/>
            <RowDefinition Height="*"/>
        </Grid.RowDefinitions>

        <!-- Back button and page title -->
        <Grid>
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="120"/>
                <ColumnDefinition Width="*"/>
            </Grid.ColumnDefinitions>
            <Button x:Name="backButton" Margin="39,59,39,0" Command="{Binding NavigationHelper.GoBackCommand, ElementName=pageRoot}"
                        Style="{StaticResource NavigationBackButtonNormalStyle}"
                        VerticalAlignment="Top"
                        AutomationProperties.Name="Back"
                        AutomationProperties.AutomationId="BackButton"
                        AutomationProperties.ItemType="Navigation Button"/>
            <TextBlock x:Name="pageTitle" Text="{StaticResource AppName}" Style="{StaticResource HeaderTextBlockStyle}" Grid.Column="1" 
                        IsHitTestVisible="false" TextWrapping="NoWrap" VerticalAlignment="Bottom" Margin="0,0,30,40"/>
        </Grid>
        <TextBlock HorizontalAlignment="Left" TextWrapping="Wrap" Text="The files are written in:" VerticalAlignment="Top" Margin="83,49,0,0" Grid.Row="1" FontSize="18"/>
        <ComboBox x:Name="FromEncoding" HorizontalAlignment="Left" VerticalAlignment="Top" Width="286" Margin="83,76,0,0" Grid.Row="1" SelectionChanged="FromEncoding_SelectionChanged" />
        <TextBlock HorizontalAlignment="Left" TextWrapping="Wrap" Text="I want to rewrite it in:" VerticalAlignment="Top" Margin="83,113,0,0" Grid.Row="1" FontSize="18"/>
        <ComboBox x:Name="ToEncoding" HorizontalAlignment="Left" VerticalAlignment="Top" Width="286" Margin="83,140,0,0" Grid.Row="1" SelectionChanged="ToEncoding_SelectionChanged" />
        <StackPanel HorizontalAlignment="Left" VerticalAlignment="Top" Margin="399,49,0,0" Grid.Row="1">
            <TextBlock Text="Encoding Name&#xD;&#xA;Displayed by:" FontSize="16" />
            <RadioButton x:Name="RadioLN" Content="Long Name" GroupName="SortMethod" Checked="RadioButtonLN_Checked" />
            <RadioButton x:Name="RadioCP" Content="Code Page Number" GroupName="SortMethod" Checked="RadioButtonCP_Checked" />
            <RadioButton x:Name="RadioSN" Content="Short Name" GroupName="SortMethod" Checked="RadioButtonSN_Checked" />
        </StackPanel>
        <Button x:Name="loadButton" Content="Load" HorizontalAlignment="Left" VerticalAlignment="Top" Margin="342,193,0,0" Grid.Row="1" Click="Button_Click" IsEnabled="False"/>
        <TextBox x:Name="fileExtensionBox" HorizontalAlignment="Left" TextWrapping="Wrap" Text=".txt" VerticalAlignment="Top" Margin="220,193,0,0" Grid.Row="1" Height="38" Width="100" FontSize="18" TextChanged="fileExtensionBox_TextChanged"/>
        <TextBlock HorizontalAlignment="Left" TextWrapping="Wrap" Text="File Extension(s)" VerticalAlignment="Top" Margin="83,209,0,0" Grid.Row="1" FontSize="18"/>
        <TextBlock HorizontalAlignment="Left" TextWrapping="Wrap" Text="Write it as '.txt' or '.txt,.smi' for multilpe extensions" VerticalAlignment="Top" Margin="83,249,0,0" Grid.Row="1" FontSize="18"/>
    </Grid>
</Page>
